FolderID Property (Folder Object) 

The FolderID property returns the unique identifier of this subfolder s parent folder as a string. Read-only.

Syntax

objFolder.FolderID

Data Type

String

Remarks

MAPI systems assign a permanent, unique identifier string when an object is created. These identifiers do not change from one MAPI session to another.

Note that MAPI systems do not require identifier values to be binary comparable. Accordingly, two identifier values can be different, yet refer to the same object. You can compare identifiers using the MAPI CompareEntryIDs method. For more information, see the MAPI Programmer s Reference.

The FolderID property corresponds to the MAPI property PR_PARENT_ENTRYID, converted to a string of hexadecimal characters.

Example

'          fragment from Session_Inbox

    Set objFolder = objSession.Inbox

'          fragment from Folder_FolderID

    strFolderID = objFolder.FolderID

    MsgBox "Parent Folder ID = " & strFolderID

'          can later restore using objSession.GetFolder(strFolderID)

'          fragment from Session_GetFolder

    If "" = strFolderID Then

        MsgBox ("Must first set folder ID variable; see Folder->ID")

        Exit Function

    End If

    Set objFolder = objSession.GetFolder(strFolderID)

    ' error checking here...

 

See Also

ID, Property (Folder Object)